package com.mnt.washio.views;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.Button;

import com.mnt.washio.R;

public class CustomFontButton extends Button {
	public CustomFontButton(Context context) {
		super(context);
	}

	public CustomFontButton(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public CustomFontButton(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		TypedArray a = context.obtainStyledAttributes(attrs,
				R.styleable.TextFont, defStyle, 0);
		if (null == fontName) {
			fontName = "Washio-Font.ttf";
		}

		Typeface tf = Typeface.createFromAsset(context.getAssets(), "fonts/"
				+ fontName);
		this.setTypeface(tf);
		a.recycle();
	}

	String fontName = null;

}